package io.renren.modules.lanling.service.impl;

import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.lanling.dao.QuestionDao;
import io.renren.modules.lanling.entity.QuestionEntity;
import io.renren.modules.lanling.service.QuestionService;


@Service("questionService")
public class QuestionServiceImpl extends ServiceImpl<QuestionDao, QuestionEntity> implements QuestionService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Query query = new Query(params);
        List<QuestionEntity> examEntityList = this.baseMapper.queryList(query);
        Integer total = this.baseMapper.queryTotal(query);
        return new PageUtils(examEntityList, total, query.getLimit(), query.getCurrPage());
    }

    @Override
    public QuestionEntity queryObject(Integer id) {
        return this.baseMapper.queryObject(id);
    }

    @Override
    public Boolean update(QuestionEntity questionEntity) {
        return this.baseMapper.update(questionEntity);
    }

    @Override
    public void deleteBySubjectId(int subjectId) {
        this.baseMapper.deleteBySubjectId(subjectId);
    }

}
